<!-- 第二步 -->

<template>
  <div class="RepairList-Step2">
    <FormSelect v-show="false" v-bind="sourceProp" />

    <EasyRow col2>
      <FormSelect v-bind="typeProps" />
      <FormSelect v-bind="subTypeProps" />
    </EasyRow>

    <EasyRow col2>
      <FormTree label="出发地" bind="areaIdStart, areaNameStart" :dict="CORE.REGION.DICT" allName required />
      <FormTree label="目的地" bind="areaIdEnd, areaNameEnd" :dict="CORE.REGION.DICT" allName required />
    </EasyRow>

    <EasyRow col2>
      <FormSelect label="运送工具" bind="deliverToolId, deliverToolName" :dict="CORE.DICT.deliver_tool" required />
      <FormTimeRange label="计划时间" bind="planTimeStart, planTimeEnd" noSecond future required />
    </EasyRow>

    <FormRadio label="紧急程度" bind="urgency" :dict="CORE.DICT.URGENCY" initFirst />

    <FormInput label="患者信息" bind="patientInfo" />

    <FormTextarea label="工单描述" bind="description" :max="500" :rows="8" required />
  </div>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import MyModal from '@admin/views/Maintain/Deliver/DeliverTemplate/MyModal'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'Step2',

  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [CORE.mixWeb('add')],

  /**
   * 组件导入 (Abc.vue + Abc/index.vue)
   */
  ...CORE.components(require.context('./', true, /vue$/)),

  /**
   * 计算属性 (慎用箭头函数)
   */
  computed: {
    ...MyModal.computed,

    /**
     * 加急状态
     */
    HURRY_STATUS() {
      return [
        [2, '是'],
        [1, '否'],
      ]
    },

    /**
     * 来源属性
     */
    sourceProp() {
      return {
        bind: 'orderSourceCode, orderSourceName, orderSourceId',
        dict: CORE.DICT.task_source.map(([id, name, code, ...other]) => [code, name, id, ...other]),
      }
    },
  },
}
</script>

<style lang="scss">
@import './index.scss';
</style>
